<html>
<head>
    <meta charset="UTF-8">
    <title>新闻添加</title>
    <link rel="stylesheet" type="text/css" href="css/news.css">
    <script src="js/jquery-1.8.2.min.js"></script>
	<script src="https://unpkg.com/vue"></script>
	<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
        $(function(){
            $("#public").load("./public.html");
        });
    </script>
	<meta http-equiv="Access-Control-Allow-Origin" content="http://10.101.147.56/month3/tp5.0/public/admin/news/add">
</head>
<body>
<div>
	<div id="public"></div>
	<div class="news_top">
		<span style="margin-left: 30px; font-size: 18px">新 闻 添 加 </span>
		<a href="news_list.html" class="news_show_title">新闻展示</a>
	</div>
	<div class="news_add_main" id="news_add">
		<form @submit.prevent="news_add_submit" method="post">
	        <table width="88%" border="0" class="tableBasic" >
	            <tr>
	                <td width="200" align="right" style="font-size: 16px;">新 闻 名 称 ： 　</td>
	                <td align="left">
	                    　<input type="text" name="news_title" value="" size="40" class="newsMain" />
	                </td>
	            </tr>
	            <tr> 
	                <td width="200" align="right" style="font-size: 16px;">新 闻 分 类 ： 　</td>
	                <td align="left">
						<select class="newsMain">
							<option value="0">请选择</option>
							<option value="" v-for="val in Cate_Content.cates" v-bind:id="val.cate_id">{{val.cate_name}}</option>
						</select>
	                </td>
	            </tr>
	            <tr>
	                <td width="200" align="right" style="font-size: 16px;">新 闻 排 序 ：　 </td>
	                <td align="left">
	                    　<input type="text" name="new_order" value="" style="width: 50px;" size="40" class="newsMain" />
	                </td>
	            </tr>
	            <tr>
	                <td width="200" align="right" style="font-size: 16px;">新 闻 小 编 ： 　</td>
	                <td align="left"> 
	                    　<input type="text" name="news_edit" value="" style="width: 100px;" size="40" class="newsMain" />
	                </td>
	            </tr>
	            <tr>
	                <td width="200" align="right" style="font-size: 16px;">新 闻 内 容 ： 　</td>
	                <td>
	                	　<textarea name="news_desc" cols="60" rows="4" class="news_add_textArea"></textarea>
	                </td>
	            </tr>
	            <tr>
	                <td width="200" align="right" style="font-size: 16px;">是 否 推 荐 ： 　</td>
	                <td>
	                    　推 荐 <input type="radio" name="news_isposn" checked value="1" size="40"/>
	                    　不 推 荐 <input type="radio" name="news_isposn" value="0" size="40" />
	                </td>
	            </tr>
	            <tr>
	                <td width="200" align="right" style="font-size: 16px;">是 否 展 示 在 导 航 栏 ：　</td>
	                <td>
	                    　是<input type="radio" name="news_ishead" checked value="1" size="40"/>
	                    　否<input type="radio" name="news_ishead" value="0" size="40" />
	                </td>
	            </tr>
	            <tr>
	                <td align="right" style="font-size: 12px;"></td>
	                <td align="left" >
	                   　<input type="submit" value="保存" style="padding: 5px 10px 5px 10px" />
	                   　<input type="reset" value="重置" style="padding: 5px 10px 5px 10px"  />
	                </td>
	            </tr>
	        </table>
    	</form>
	</div>
</div>
<script src="http://cdn.bootcss.com/vue/2.1.0/vue.js" type="text/javascript" charset="utf-8"></script>
<script src="http://cdn.bootcss.com/vue-resource/1.0.3/vue-resource.js" type="text/javascript" charset="utf-8"></script>
<script>
	new Vue({
		el:'#news_add',
		data: {
			Cate_Content:[],
			cate_content_url: 'http://10.101.147.56/month3/tp5.0/public/admin/cate/index ', //存数据接口
			News_Content:[],
			News_content_add:'http://10.101.147.56/month3/tp5.0/public/admin/news/add '
		},
		created: function(){
			this.getImg() ;      //定义方法
		},
		methods: {
			getImg: function(){
				this.$http({      //调用接口
					method:'GET',
					url:this.cate_content_url //this指data
				}).then(function(response){ //接口返回数据
					//console.log(response.data);
					this.Cate_Content=response.data;
				},function(error){
					console.log(error);
				})
			}
		}
	});
</script>
</body>
</html>